<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <!-- <button @click = "isLoad = true" >切换A</button>
        <button @click = "isLoad = false">切换B</button> -->

        <button @click = "type=1" >切换A</button>
        <button @click = "type=2">切换B</button>
        <button @click = "type=3">切换B</button>
        <!-- 1.0 v-if 渲染 -->
        <!-- <p v-if = isLoad>AAA</p> -->
        <!-- <p v-if = !isLoad>BBB</p> -->

        <!-- 2.0 v-else -->
        <!-- <p v-if = isLoad>AAA</p> -->
        <!-- <p v-else>BBB</p> -->

        <!-- 3.0 v-else-if -->
        <p v-if = "type===1">AAA</p>
        <p v-else-if = "type===2">BBB</p>
        <p v-else>CCC</p>
    </div>
    <script>
        Vue.config.productionTip = false;
        
        const vm = new Vue({
            el: "#app",
            data() {
                return {
                    isLoad : true,
                    type : 1
                }
            }
        })
</script>
</body>

</html>